﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XSTDZ.ERP.Core.Extentions;
using XSTDZ.ERP.Core.Generator;

namespace XSTDZ.ERP.Domain.Models
{
    /// <summary>
    /// 入库单明细
    /// </summary>
    public partial class ProductInBillDetail
    {
        public ProductInBillDetail Init()
        {
            if (this.Id.Equals(Guid.Empty))
            {
                this.Id = (Guid)new SequentialIdentityGenerator().Next;
            }
            return this;
        }
        /// <summary>
        /// 设置删除状态（若为删除，则置为正常，否则为删除）
        /// </summary>
        /// <returns></returns>
        public ProductInBillDetail SetDeleteState()
        {
            this.Deleted = this.Deleted == 0 ? 1 : 0;
            return this;
        } 
    }
}
